
    <div class="indexWidth">
        <button type="button" class="btn btn-info mainButtonRight"><a
                href="javascript:takeout.openMenu('${ctxPath!}/option/list', null)" class="mianAcolor">返回</a></button>

        <div class="sectionTitle">
            设置内容
            <hr>
        </div>
<form id="optionForm" action="${ctxPath!}/option/save" method="POST" class="form-horizontal">
    <input type="hidden"  name="option.id" class="mainSetWidth" value="${option.id!}" />
    <input type="hidden"  name="option.questionid" class="mainSetWidth" value="${option.questionid!}" />

    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">题目：</label>
        <input type="text" name="option.title" class="mainSetWidth" value="${option.title!}"/>
    </div>

    <div id="options">
        <!--<div class="articleFormLabel">-->
            <!--<label class="mainSetConsistentWidth">选项：</label>-->
            <!--<input type="text" name="item" class="mainSetWidth-options" placeholder="选项"/>-->
            <!--<input type="text" name="item" class="mainSetWidth-options-score" placeholder="分数"/>-->
            <!--<label class="mainSetConsistentWidth"><a href="">删除</a></label>-->
        <!--</div>-->
    </div>
    <div class="articleFormLabel">
        <button style="margin-left: 100px;width:95px;margin-bottom: 15px;"
                class="btn btn-info articleFormButton"
                type="button" onclick="javascript:takeout.addOptions('options')">
            添加选项
        </button>
    </div>

    <!--<div class="articleFormLabel">-->
    <!--<label class="mainSetConsistentWidth">选项1：</label>-->
    <!--<input type="text" name="option.item1" class="mainSetWidth" value="${option.item1!}"  placeholder=""/>-->
    <!--</div>-->

    <!--<div class="articleFormLabel">-->
    <!--<label class="mainSetConsistentWidth">选项2：</label>-->
    <!--<input type="text" name="option.item2" class="mainSetWidth" value="${option.item2!}"  placeholder=""/>-->
    <!--</div>-->

    <!--<div class="articleFormLabel">-->
    <!--<label class="mainSetConsistentWidth">选项3：</label>-->
    <!--<input type="text" name="option.item3" class="mainSetWidth" value="${option.item3!}"  placeholder=""/>-->
    <!--</div>-->

    <!--<div class="articleFormLabel">-->
    <!--<label class="mainSetConsistentWidth">选项4：</label>-->
    <!--<input type="text" name="option.item4" class="mainSetWidth" value="${option.item4!}"  placeholder=""/>-->
    <!--</div>-->

    <!--<div class="articleFormLabel">-->
    <!--<label class="mainSetConsistentWidth">得分：</label>-->
    <!--<input type="text" name="option.score" class="mainSetWidth" value="${option.score!}" />-->
    <!--</div>-->


    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">排序：</label>
        <input type="text" name="option.sort" class="mainSetWidth" value="${option.sort!}"/>
    </div>


    <div class="form-group">
        <button style="margin-left: 100px;width:95px;" class="btn btn-info articleFormButton" type="button"
                onclick="takeout.ajaxFormMainPanel('optionForm')">保存
        </button>

        <!--<button style="margin-left: 100px;width:95px;" class="btn btn-info articleFormButton" type="button"-->
                <!--onclick="takeout.ajaxFormMainPanel('optionForm')">继续添加-->
        <!--</button>-->
    </div>


</form>
<script type="text/javascript">
$(document).ready(function () {
    var data = JSON.parse('${option.items!}');
    var vals = JSON.parse('${option.values!}');
    for(var i = 0; i < data.length; i ++){
        var content = createContent(data[i], vals[i]);
        $('#options').append(content);
    }
})
    function createContent(content, val) {
        return '<div class="articleFormLabel">\n' +
            '            <label class="mainSetConsistentWidth">选项：</label>\n' +
            '            <input type="text" name="item" class="mainSetWidth-options" value="'+ content + '" placeholder="选项"/>\n' +
            '            <input type="text" name="score" class="mainSetWidth-options-score" value="'+ val + '" placeholder="分数"/>\n' +
            '            <label class="mainSetConsistentWidth">' +
            '<a href="javascript:void();" onclick="takeout.delOptions(this)">删除</a></label>\n' +
            '        </div>';
    }
</script>